namespace a {
    // 测试instanceof 运算符
    class Animal3 {
        name: string
        constructor(name: string) {
            this.name = name
        }
    }
    class Brid1 {
        // class Brid1 extends Animal3{
        name: string
        age: number
        constructor(name: string, age: number) {
            // super(name)
            this.name = name
            this.age = age
        }
    }
    function getName(a1: Animal3) {
        if (a1 instanceof Animal3) {
            console.log('我是Animal3')
        } else {
            console.log('我是Brid1')
        }
    }
    let a1: Animal3 = { name: 'ss' }
    let a2 = new Animal3('sss')
    let a3 = new Brid1('吴鹏丽', 27)
    getName(a3)
    // console.log([] instanceof Array)
    // Pick类型从我们传入的类型中摘取某一项返回
    // 条件类型
    interface Fish {
        fish: string
    }

    interface Bird {
        bird: string
        fish: string
    }
    // 目标接口
    interface Water {
        water: string
    }
    interface Sky {
        sky: string
    }
    //三元运算符
    type Condition<T> = T extends Fish ? Water : Sky;
    // 通过条件判断类型是Water,只要T包含了Fish的属性，则被认为成功
    let condition1: Condition<Bird> = {
        water: 'water'
    }
    // type Exclude2<T, U> = U extends T ? T : never;
    // type E = Exclude<string | number, number>;
    // let e1: E = 10;
    // type E2 = NonNullable<string | number | null | undefined>;
    // let e2: E2 = null;
    /**
     * Obtain the return type of a function type
     */
    interface A {
        a:string
        b:number
    }
    interface B {
        c:string
        b:number
    }
    type C = A | B
    let c1:C = {
        a:'',
        b: 0,
        c: ''
    }
}